home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* */
- /* interfaces for a simple, MULTI-window graphics shell */
- /* */
- /* ©1990 - 1994 Apple Computer, Inc. */
- /* All rights reserved. */
- /* */
- /****************************************************************************/
-
- #include <Desk.h>
- #include <Events.h>
- #include <Fonts.h>
- #include <Windows.h>
- #include <Memory.h>
- #include <ToolUtils.h>
- #include <Menus.h>
- #include <Resources.h>
- #include <Quickdraw.h>
- #include <GestaltEqu.h>
- #include <CodeFragments.h>
-
- #include "graphics toolbox.h"
- #include "graphics routines.h"
- #include "graphics libraries.h"
- #include "graphics debugging.h"
- #include "graphics macintosh.h"
- #include "font library.h"
- #include "qd library.h"
- #include "PrintingMessages.h"
- #include "PrintingManager.h"
-
-
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| EXTERN GLOBALS
- |**| ---------------------------------------------------------------------
- \**/
- // the following are expected to be initialized by the shell:
-
- // QuickDraw GX shell.c:
-
- extern Boolean gQuitting;
-
- // the following are expected to be initialized by your code:
-
- extern Rect gWindowQDRect;
- extern Str255 gWindowTitle;
- extern Boolean gDebugging;
- extern Boolean gGiveMeValidation;
- extern long gGraphicsHeapSize;
-
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| PROTOTYPES
- |**| ---------------------------------------------------------------------
- \**/
-
- // QuickDraw GX shell.c:
-
- void main (void);
- void InitToolbox (void);
- void CheckQuickDrawGX (void);
- OSErr MyPrintingEventOverride (EventRecord *event, Boolean filterEvent);
- void EventLoop (void);
- Boolean IsAppWindow (WindowPtr wind);
- void MyDoEvent (EventRecord *event);
- void DoMouseDown (EventRecord *event);
-
- // QDGX shell misc.c:
-
- void DoMenuCommand (long menuResult);
- gxJob GetDocJob (WindowPtr);
- gxShape GetDocShape (WindowPtr);
- short MyStrLength (char *s);
-
- // QDGX shell printing.c:
-
- void SetUpEditMenuRec (gxEditMenuRecord *);
- OSErr DoFormat (WindowPtr, gxDialogResult *);
- OSErr DoPrinting (WindowPtr);
- OSErr DoPrintOne (WindowPtr);
-
- // routines required by your code
- void DoSetup (void);
- void DoDraw (WindowPtr wind, Boolean updating);
- OSErr DoCreateNew (void);
- void DoDispose (WindowPtr wind);
- void DoIdle (WindowPtr wind);
- void DoTeardown (void);
- void DoClick (WindowPtr wind, Point p);
-
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| ENUMS
- |**| ---------------------------------------------------------------------
- \**/
- enum dlogIDs {rAboutBoxID=128,rNoQuickDrawGXID=129};
-
- enum mbarID {rMenuBar=128};
-
- enum menus {mApple=128,mFile,mEdit};
-
- enum mApplItems {iAbout=1};
- enum mFileItems {iNew=1,iOpen,iClose,iSave,iPageSetup=6,iPrint,iPrintOne,iQuit=10};
- enum mEditItems {iUndo=1,iCut=3,iCopy,iPaste,iClear};
-
-
- /**\
- |**| ---------------------------------------------------------------------
- |**| STRUCTS
- |**| ---------------------------------------------------------------------
- \**/
- // This is the structure we use to hold our private data for each window.
- // We store a handle to one of these beasties in each window's refCon field.
-
- typedef struct
- {
- gxJob docJob; // print job for this document.
- gxShape docPage; // page shape description for this document.
- } T_Doc, *TP_Doc, **TH_Doc;
-